﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		CommentBinder.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System.ComponentModel.DataAnnotations;
using Dexter.Core.Helpers;
using Dexter.Web.Mvc.ViewModel.Resources;

namespace Dexter.Web.Mvc.ViewModel.FrontEnd.Binders {
	public class CommentBinder {
		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 500 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string Author { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 250 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[RegularExpression ( KnownRegex.MailAddress , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "InvalidFormat" )]
		public string Email { get; set; }

		public bool Notify { get; set; }

		[StringLength ( 1000 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[RegularExpression ( KnownRegex.Url , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "InvalidFormat" )]
		public string Url { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		public string Comment { get; set; }
	}
}
